package com.xinsoft.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import javax.validation.constraints.Digits;
import javax.validation.constraints.Positive;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 销售订单明细——商品
 *
 * @TableName scm_sale_item
 */
@TableName(value = "scm_sale_item")
@Data
public class ScmSaleItem {
    /**
     * 销售订单明细ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 销售订单ID
     */
    @TableField(value = "sale_id")
    private Integer saleId;

    /**
     * 物料ID
     */
    @TableField(value = "material_id")
    private Integer materialId;

    /**
     * 销售数量
     */
    @TableField(value = "sale_num")
    @Positive(message = "销售数量必须大于0")
    private BigDecimal saleNum;

    /**
     * 含税单价
     */
    @TableField(value = "tax_unit_price")
    private BigDecimal taxUnitPrice;

    /**
     * 不含税单价
     */
    @TableField(value = "unit_price")
    private BigDecimal unitPrice;

    /**
     * 税率
     */
    @TableField(value = "tax")
    @Digits(integer = 2, fraction = 2, message = "总位数不能超过4")
    private BigDecimal tax;

    /**
     * 含税总价
     */
    @TableField(value = "tax_total_price")
    private BigDecimal taxTotalPrice;

    /**
     * 不含税总价
     */
    @TableField(value = "total_price")
    private BigDecimal totalPrice;

    /**
     * 是否发货检
     */
    @TableField(value = "do_send_check")
    private Integer doSendCheck;

    /**
     * 交货日期
     */
    @TableField(value = "delivery_date")
    private Date deliveryDate;

    /**
     * 备注
     */
    @TableField(value = "remarks")
    private String remarks;

    /**
     * 是否行关闭 0-否 1 - 是
     */
    @TableField(value = "do_close")
    private Integer doClose;

    /**
     * 关闭时间
     */
    @TableField(value = "close_time")
    private Date closeTime;

    /**
     * 关闭原因
     */
    @TableField(value = "close_reason")
    private String closeReason;

    /**
     * 辅助单位
     */
    @TableField(value = "support_uom")
    private Integer supportUom;

    /**
     * 换算系数
     */
    @TableField(value = "conv_coefficient")
    @Positive(message = "换算系数只能是正数（大于0）")
    private BigDecimal convCoefficient;

}